package com.concurrent.data.thread.service;

import com.concurrent.data.thread.config.RabbitMqConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 哲思小辉
 * @version 1.0.0
 * @ClassName QueueProvider.java
 * @Description 消息队列生产者
 * @Param
 * @createTime 2020年06月19日 16:52:00
 */

@Component
@Slf4j
public class QueueProvider {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(String content) {
        this.rabbitTemplate.convertAndSend(RabbitMqConfig.RABBITMQ_ORDER_QUEUE_NAME, content);
    }
}
